﻿namespace EAL
{
    using System;
    using System.Windows;
    using EAL.Misc;

    /// <summary>
    /// Interaktionslogik für SendError.xaml
    /// </summary>
    public partial class SendError : Window
    {
        public SendError()
        {
            InitializeComponent();
        }

        public void setMessage(Exception ex)
        {
            if ((ex.Message != "") && (ex != null))
            {
                this.MessageBlock.Text = ex.Message;
                this.exception = ex;
            }
        }

        public void send_click(object sender, EventArgs ea)
        {
            report = new Reporting();
            report.SendError(this.exception);
            Application.Current.Shutdown();
        }

        public void nosend_click(object sender, EventArgs ea)
        {
            Application.Current.Shutdown();
        }

        internal Reporting report { get; set; }

        public Exception exception { get; set; }
    }
}
